<template>
  <el-config-provider :locale="zhCn">
    <router-view></router-view>
  </el-config-provider>
</template>

<script setup>
import { onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useAppStore } from '@/stores/app'
import { setTitleFromRoute } from '@/utils/common'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { useI18n } from 'vue-i18n'

const route = useRoute()
const appStore = useAppStore()
const { locale } = useI18n()

onMounted(() => {
  // 初始化操作
})

// 监听路由变化时更新浏览器标题
watch(
  () => route.path,
  () => {
    setTitleFromRoute(route)
  }
)
</script>

<style>
/* 全局样式可以在styles/index.scss中定义 */
</style>